$.ajaxPrefilter(function(option) {
    option.url = 'http://localhost:8888' + option.url
    if (option.url.indexOf('/admin') !== -1) {
        option.headers = {
            Authorization: localStorage.getItem('token') || ''
        }
    }
    option.complete = function(res) {
        if (res.responseJSON.message === '身份认证失败' && res.responseJSON.code == 1) {
            localStorage.removeItem('token');
            localStorage.href = '/login.html'
        }
    }
})